//
//  Emoticon.m
//  XinLang_OC
//
//  Created by WONG on 16/4/23.
//  Copyright © 2016年 cheuhui. All rights reserved.
//

#import "Emoticon.h"

@implementation Emoticon

- (instancetype)initWithId:(NSString *)id dict:(NSDictionary *)dict {
    if(self = [super init]) {
        self.id = id;
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}

+ (instancetype)initWithId:(NSString *)id dict:(NSDictionary *)dict {
    return [[Emoticon alloc] initWithId:id dict:dict];
}

- (instancetype)initWithRemoveEmoticon:(BOOL)removeEmoticon {
    if (self = [super init]) {
        self.removeEmoticon = removeEmoticon;
    }
    return self;
}

+ (instancetype)initWithRemoveEmoticon:(BOOL)removeEmoticon {
    return [Emoticon initWithRemoveEmoticon:removeEmoticon];
}


// 字典的key在模型中找不到对应的属性
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {}

- (NSString *)description {
    return nil;
}

- (void)setPng:(NSString *)png {
    _png = png;
    
    // 计算图片的完整路径 = bundlePath + 表情包文件夹名称 + 图片名称
    self.pngPath = [bundlePath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@/%@",self.id,self.png]];
}

- (void)setCode:(NSString *)code {
    _code = code;
    // 扫描
//    NSScanner *scanner = [[NSScanner alloc] initWithString:code];
//    
//    // result: UnsafeMutablePointer<UInt32>: UInt32指针
//    UInt32 result = 0;
//    
//    // 将结果赋值给result
//    [scanner scanHexInt:&result]; 
    
    
    
}





@end




















